#include "global.h"
#include "hHuffman.h"

using namespace std;


int main()
{
	//string s = "hello world!";
	string s = "After building, there will be a large collection of executables in the bin directory. These are the example applications, which you can directly execute.\nThe media is now included with the git repository, and the samples should compileand run out - of - the box.Of course, make sure your OpenGL drivers are up to dateand that your hardware is capable of running OpenGL 4.5.That's what this book is about. Some systems don't support OpenGL 4.5 and will therefore not run some of the samples.Trying to run such samples on a machine that doesn't have OpenGL 4.5 support will fail. For example, if a platform were limited to, say OpenGL 4.1, then the samples wouldn't work on that platform.Please don't file bugs about that either. Error checking in these applications is minimal. If you don't have media files or if your OpenGL drivers are out of date, they'll probably fail spectacularly.";

	cout << s << endl;

	hBitStr bit;
	string str;

#define _CODE_DECODE
//#define _CODE_DECODE_EX1
#define _CODE_DECODE_EX2
#ifdef _CODE_DECODE
	std::cout << "[CodeCallback]" << std::endl;
	Huffman::code(bit, s.data(), s.size() + 1);
	std::cout << "[DecodeCallback]" << std::endl;
	Huffman::decode(str, bit);
#endif

#ifdef _CODE_DECODE_EX1
	std::cout << "[CodeEx1Callback]" << std::endl;
	Huffman::codeEx1(bit, s.data(), s.size() + 1);
	std::cout << "[DecodeEx1Callback]" << std::endl;
	Huffman::decodeEx1(str, bit);
#endif

#ifdef _CODE_DECODE_EX2
	std::cout << "[CodeEx2Callback]" << std::endl;
	Huffman::codeEx2(bit, s.data(), s.size() + 1);
	std::cout << "[DecodeEx2Callback]" << std::endl;
	Huffman::decodeEx2(str, bit);
#endif
	return 0;
}